package Com.javaserver.servlet;

import Com.javaserver.bean.admid;
import Com.javaserver.dao.addmiserver;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/admiup")
public class    admiupserverlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("UTF-8");
        admid a=new admid();
        a.setId(Integer.parseInt(req.getParameter("id")));
        a.setAccount(req.getParameter("name"));
        a.setPassword(req.getParameter("password"));
        addmiserver bs=new addmiserver();
        bs.admiup(a);
        resp.sendRedirect(req.getContextPath()+"/index.jsp");
    }
    }

